import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-09-16
 * Time: 11:27
 */


//UDP 的api:  DatagramSocket、DatagramPacket
public class demo1 {

    public static void main(String[] args) throws IOException {

        byte[] bytes = new byte[1024];
        DatagramSocket socket = new DatagramSocket();//参数是端口号
        DatagramPacket packet = new DatagramPacket(bytes, 1024);//


        socket.receive(packet);//接收数据报
//        socket.send();//发送数据报






    }

}
